package com.example.emoiticon.adapter;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SessionManager {
	SharedPreferences pref;

    // Editor for Shared preferences
    Editor editor;

    // Context
    Context _context;

    // Shared pref mode
    int PRIVATE_MODE = 0;

    // Sharedpref file name
    private static final String PREF_NAME = "demo";


    // Constructor
    public SessionManager(Context context) {
        this._context = context;
        pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
        editor = pref.edit();
    }



    /**
     * Set and get User Data
     */
    public void setUserData(int userData) {
        // Storing name in pref
        editor.putInt("userData", userData);
        editor.commit();
    }

    public int getUserData() {
        return pref.getInt("userData", 0);
    }
}
